package com.mysite.dubbox.test;

import com.mysite.dubbox.facade.UserFacade;
import com.mysite.dubbox.vo.UserVo;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ConsumerDubbo {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:dubbox-consumer-test.xml");
        context.start();
        UserFacade userService = (UserFacade)context.getBean("userService");
        UserVo vo  = userService.getUser(1L);
        System.err.println("query result is: " + vo.getName());

        Long id = userService.registerUser(new UserVo(30L, "zhangsan"));
        System.err.println("inserted id is: " + id);
    }
}
